package org.example.runningforum.server;

import org.example.runningforum.mapper.IArticleTopicMapper;
import org.example.runningforum.modle.ArticleTopic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleTopicService {

    @Autowired
    private IArticleTopicMapper iArticleTopicMapper;
    public List<ArticleTopic> selectCountAndName(){
        return iArticleTopicMapper.selectCountAndName();
    }


    public int insertArticleTopic(ArticleTopic articleTopic){
        Long articleId = articleTopic.getArticleId();
        Long topicId = articleTopic.getTopicId();

        return iArticleTopicMapper.insertArticleTopic(articleId, topicId);
    }


}
